import Vue from 'vue'
import App from './App.vue'
import cookie from "js-cookie";

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './api/mock'

import router from "../router/index"

import store from '../src/store/index'


Vue.config.productionTip = false
console.log('222')
console.log(!cookie.get("lll","kjjkjhjk"))
// router.beforeEach((to, from, next) => {
//     if (!cookie.get("taken") && to.name!=='login') {
//        next({name:'login'})
//     }else if(cookie.get("taken") && to.name==="login"){
//         next({name:'home'})
//     }else {
//         next()
//     }
// })

Vue.use(ElementUI)

new Vue({
    store,
    router: router,
    render: h => h(App),
    beforeCreate() {
        Vue.prototype.$bus = this
    }
}).$mount('#app')
